﻿$(function() {
	var app = angular.module('myApp', [ 'toaster', 'ngAnimate', 'ngCookies' ]);
	app.controller('myCtrl', function($scope, $rootScope, $http, $cookieStore,
			toaster) {
		$scope.isOpen = false;
		$scope.interfaceIsShowChild = false;
		$scope.testCaseIsShowChild = false;
		$scope.myWorkIsShowChild = false;
		$scope.qualityIsShowChild = false;
		$scope.mySelfIsShowChild = false;
		$scope.interfaceChild = {
			"display" : "none"
		}
		// 控制点击头像就弹出几个自列表的功能
		$scope.clickMySelf = function() {
			$scope.isOpen = !$scope.isOpen;
		}
		// 控制左侧菜单隐藏功能
		$scope.isSidebarClose = false;
		$scope.clickSidebarClose = function() {
			$scope.isSidebarClose = !$scope.isSidebarClose;
		}

		// 控制各个子模块的展开
		// 接口
		$scope.interfaceIsShowClick = function() {
			$scope.interfaceIsShowChild = !$scope.interfaceIsShowChild;
			if ($scope.interfaceIsShowChild == true) {
				$scope.interfaceChild = {
					"display" : "block"
				}
			} else {
				$scope.interfaceChild = {
					"display" : "none"
				}
			}
		}
		// 用例
		$scope.testCaseIsShowClick = function() {
			var userinfo=$("#userInfo").val();
			$scope.testCaseIsShowChild = !$scope.testCaseIsShowChild;
			if ($scope.testCaseIsShowChild == true) {
				$scope.testCaseChild = {
					"display" : "block"
				}
			} else {
				$scope.testCaseChild = {
					"display" : "none"
				}
			}
		}
		// 日志
		$scope.myWorkIsShowClick = function() {
			$scope.myWorkIsShowChild = !$scope.myWorkIsShowChild;
			if ($scope.myWorkIsShowChild == true) {
				$scope.myWorkChild = {
					"display" : "block"
				}
			} else {
				$scope.myWorkChild = {
					"display" : "none"
				}
			}
		}
		// 质量
		$scope.qualityIsShowClick = function() {
			$scope.qualityIsShowChild = !$scope.qualityIsShowChild;
			if ($scope.qualityIsShowChild == true) {
				$scope.qualityChild = {
					"display" : "block"
				}
			} else {
				$scope.qualityChild = {
					"display" : "none"
				}
			}
		}
		// 我的
		$scope.mySelfIsShowClick = function() {
			$scope.mySelfIsShowChild = !$scope.mySelfIsShowChild;
			if ($scope.mySelfIsShowChild == true) {
				$scope.mySelfChild = {
					"display" : "block"
				}
			} else {
				$scope.mySelfChild = {
					"display" : "none"
				}
			}
		}
	});
});
function SetWinHeight(obj) {
	var win = obj;
	if (document.getElementById) {
		if (win && !window.opera) {
			if (win.contentDocument && win.contentDocument.body.offsetHeight)
				win.height = win.contentDocument.body.offsetHeight;
			else if (win.Document && win.Document.body.scrollHeight)
				win.height = win.Document.body.scrollHeight;
		}
	}
}
